Overview

Resolver is a simple COM object (built in Visual C++) that can do forward and reverse lookups on internet IP addresses and hostnames. For information on how to use the component, see the method reference below.

Methods

GetAddrByHost | Resolves a hostname to an IP address
GetHostByAddr | Resolves an IP address to a hostname

Contact Information

How to purchase the component

License Agreement


Network addressing

Internet Addresses

Values specified using the ".'' notation take one of the following forms:

a.b.c.d

a.b.c

a.b

a

When four parts are specified, each is interpreted as a byte of data and assigned, from left to right, to the four bytes of an Internet address. When an Internet address is viewed as a 32-bit integer quantity on the Intel architecture, the bytes referred to above appear as "d.c.b.a''. That is, the bytes on an Intel processor are ordered from right to left.

The parts that make up an address in "." notation can be decimal, octal or hexidecimal as specified in the C language. Numbers that start with "0x" or "0X" imply hexidecimal. Numbers that start with "0" imply octal. All other numbers are interpreted at decimal.

"4.3.2.16" decimal

"004.003.002.020" octal

"0x4.0x3.0x2.0x10" hexidecimal

"4.003.002.0x10" mix

Note The following notations are only used by Berkeley, and nowhere else on the Internet. In the interests of compatibility with their software, they are supported as specified.

When a three part address is specified, the last part is interpreted as a 16-bit quantity and placed in the right most two bytes of the network address. This makes the three part address format convenient for specifying Class B network addresses as "128.net.host''.

When a two part address is specified, the last part is interpreted as a 24-bit quantity and placed in the right most three bytes of the network address. This makes the two part address format convenient for specifying Class A network addresses as "net.host''.

When only one part is given, the value is stored directly in the network address without any byte rearrangement.

For more information, see MSDN Online.


GetAddrByHost

Syntax:

object.GetAddrByHost HostName, IPAddress

Parameters:

object | An object expression that evaluates to a WSResolver object
HostName | A string variable that represents the network hostname to resolve to an IP address.
IPAddress | A string variable that will be filled in by the object. It will represent either the IP address (in dotted format), or a string containing the word 'Error' and an errorcode.

Remarks:

Call this method to resolve a hostname to an IP address.

The string variable IPAddress must be initialized prior to calling the method. In Visual C++, this means that you must first allocate memory for the string before passing in the LPSTR. In Visual Basic, this means creating a string variable of fixed length (see the example below).

Example:

' Be sure to add the 'Resolver 1.0 type library' to your list of references

' Create the WSResolver object:
Dim objResolver As New WSResolver

' Create our string (to be filled in by
' the object -- it will contain our IP address
' or a string containing the word 'Error' and an
' errorcode
Dim sTempString As String * 255

' Call the method on the object (we're looking
' for the host named 'azissql', but you could easily
' substitute 'www.microsoft.com')
objResolver.GetAddrByHost "azissql", sTempString

' print the string to the debug window
Debug.Print sTempString

' call release on the COM object:
Set objResolver = Nothing


GetHostByAddr

Syntax:

object.GetHostByAddr IPAddress, HostName

Parameters:

object | An object expression that evaluates to a WSResolver object
IPAddress | A string variable that represents the IP address (in dotted format) to resolve to a hostname.
HostName | A string variable that will be filled in by the object. It will represent either the hostname, or a string containing the word 'Error' and an errorcode.

Remarks:

Call this method to resolve an IP to a hostname.

The string variable HostName must be initialized prior to calling the method. In Visual C++, this means that you must first allocate memory for the string before passing in the LPSTR. In Visual Basic, this means creating a string variable of fixed length (see the example for GetAddrByHost).


Contact Information

Feel free to contact Dan Esparza by the following means:

Web site: | http://home1.gte.net/cdnet/resolver/resolver.htm
Email: | DanEsparza@kagi.com


Purchasing Information

The Resolver component translates host names to and from IP addresses.

Registration: $5 (US)

Source code and Site license (10 user) Registration: $30 (US)

Source code and WorldWide site license (150 user) Registration: $200 (US)

You can purchase the component online (using SSL encryption), or online (without SSL encryption), or use the WinRegister tool, included with the download package.


License Agreement

Dan Esparza Software grants a license to use the enclosed software to the original purchaser. Copies may be made for back-up purposes only. Copies made for any other purpose are expressly prohibited, and adherence to this requirement is the sole responsibility of the purchaser.

Customer written executable applications containing embedded Dan Esparza products may be freely distributed, without royalty payments to Dan Esparza Software, provided that such distributed Dan Esparza product is bound into these applications in such a way so as to prohibit separate use in design mode, and that such Dan Esparza product is distributed only in conjunction with the customers own software product. The Dan Esparza Software product may not be distributed by itself in any form.

Neither source code for Dan Esparza Software products nor modified source code for Dan Esparza Software products may be distributed under any circumstances, nor may you distribute .OBJ, .LIB, etc. files that contain our routines. This control may be used as a constituent control only if the compound control thus created is distributed with and as an integral part of an application. Permission to use this control as a constituent control does not grant a right to distribute the license or any file other than the control executable itself.This license may be transferred to a third party only if all existing copies of the software and its documentation are also transferred.

This product is licensed for use by only one developer at a time. Dan Esparza Software expressly prohibits installing this product on more than one computer if there is any chance that both copies will be used simultaneously. This restriction also extends to installation on a network server, if more than one workstation will be accessing the product. All developers working on a project which includes a Dan Esparza Software product, even though not working directly with the Dan Esparza product, are required to purchase a license for that Dan Esparza product.

This software is provided as is. Dan Esparza Software makes no warranty, expressed or implied, with regard to the software. All implied warranties, including the warranties of merchantability and fitness for a particular use, are hereby excluded.

DAN ESPARZA SOFTWARE'S LIABILITY IS LIMITED TO THE PURCHASE PRICE. Under no circumstances shall Dan Esparza Software or the authors of this product be liable for any incidental or consequential damages, nor for any damages in excess of the original purchase price.

To be eligible for free technical support by telephone, the Internet, etc. and to ensure that you are notified of any future updates, please complete the enclosed registration card and return it to Dan Esparza Software.

Your license is transferable. The original purchaser of the product must make the transfer request. Contact us for further information.